#ifndef ClientFlashBang_H
#define ClientFlashBang_H

#include "Engine.h"
#include "InputSet.h"
#include "MotionState.h"
#include <OgreEntity.h>
#include "PlayingFieldConstants.h"
#include "ScoreCard.h"
#include "RiotShield.h"
#include <SDL/SDL_mixer.h>
#include <stdlib.h>
#include "NetworkTarget.h"
#include "NetworkUtils.h"

#define SCORE 5

//a class that represents a flash bang in the scene
class ClientFlashBang : public NetworkTarget{
public:
	ClientFlashBang(char* name, Ogre::SceneManager* sm, Ogre::SceneNode* toAddTo);
	void updateState();
	void alertToInput( const InputSet& input );
	virtual void messageUpdate(char *message, int length);
protected:
	MotionState myPos;
	Ogre::SceneNode* myNode;
	Mix_Chunk* shieldBounce;
	Mix_Chunk* wallBounce;
	Mix_Chunk* myEyesAHHH;
	Mix_Chunk* explosion;
	bool soundLive;
	bool lock;
	bool gameOver;
	
	void playWallContact();
	void playShieldContact();
	void playOhGodMyEyes();
	Converter conv;
	//used to synchronize access to the above members
	pthread_mutex_t flashLock;
};

#endif
